var rot=function(nums,k){
    const n=nums.length
    const newarr=new Array(n)
    for(let i=0;i<n;i++){
        newarr[(i+k)%n]=nums[i]
    }
    for(let i=0;i<n;i++){
        nums[i]=newarr[i]
    }
    return nums
}